package com.mdb.open.common.enums.trade.type;

import com.mdb.bc.api.enums.ApiEnum;

public enum RoleTypeEnum implements ApiEnum<String> {
	/**
	 * 平台客户
	 */
	PLATFORM("平台客户"),
	/**
	 * 商户
	 */
	MERCHANT("商户"),
	/**
	 * 关联公司
	 */
	RELATED_COMPANY("关联公司"),
	CONTACT("联系人"),
	LEGAL_PERSON("法人"),
	;

	String desc;

	RoleTypeEnum(String desc) {
		this.desc = desc;
	}

	@Override
	public String getValue() {
		return this.name();
	}

	@Override
	public String getText() {
		return this.desc;
	}

	public RelationTypeEnum getRelationTye(RoleTypeEnum roleTypeEnum){
		RelationTypeEnum relationTypeEnum = null;
		switch (roleTypeEnum.getValue()){
			case "PLATFORM":
				break;
			case "MERCHANT":
				relationTypeEnum = RelationTypeEnum.MERCHANT;
				break;
			case "RELATED_COMPANY":
				relationTypeEnum = RelationTypeEnum.BIZ_SUBJECT_COMPANY;
				break;
			case "CONTACT":
				relationTypeEnum = RelationTypeEnum.CONTACT;
				break;
			case "LEGAL_PERSON":
				relationTypeEnum = RelationTypeEnum.LEGAL_PERSON;
				break;
				default:

		}
		return relationTypeEnum;
	}

}
